package com.scalar.chiptrack.adaptor.spil;

/**
 * Created by Sudhakar.
 * User: sudhakar.guntupalli
 * Date: Jan 20, 2006
 * Time: 1:14:49 PM
 
 */
public class SPILWipStatus
{

    private String customerLot  = null;
    private String fabLot       = null;
    private String prodLot      = null;
    private String device       = null;
    private String packageType  = null;
    private String body         = null;
    private String leadCount    = null;

    /* Sort*/
    private String wsrcv        = null;
    private String wsInQty      = null;
    private String wsbk         = null;
    private String probe        = null;
    private String wsfgWafer    = null;
    private String wsfgDie      = null;
    private String wsSOD        = null;
    private String wsTran       = null;

   

    /* Assembly*/
    private String asRcvDate        = null;
    private String asRcvDie     = null;
    private String asBkWafer    = null;
    private String asBkDie      = null;
    private String loadDate         = null;
    private String asActualQty  = null;
   private String opticalInspect = null;
    private String dieAttach    = null;
    private String wireBond     = null;
    private String molding      = null;
    private String plating      = null;
    private String forming      = null;
    private String packing      = null;
    private String lossQty      = null;
    private String asSod        = null;
    private String asrSod       = null;
    private String asTran       = null;

    /* Final Test */

    private String ftRcvDate    = null;
    private String ftBk         = null;
    private String ftQty        = null;
    private String ftLsQty      = null;
    private String ftBaking     = null;
    private String ftpacking    = null;
    private String ftOQCDate    = null;
    private String ftSod        = null;
    private String ftrSod       = null;
    private String shipTo       = null;
    private String rem          = null;
    private String rem2         = null;
    private String uncfm        = null;

    public String getCustomerLot()
    {
        return customerLot;
    }

    public void setCustomerLot( String customerLot )
    {
        this.customerLot = customerLot;
    }

    public String getFabLot()
    {
        return fabLot;
    }

    public void setFabLot( String fabLot )
    {
        this.fabLot = fabLot;
    }

    public String getProdLot() {
        return prodLot;
    }

    public void setProdLot(String prodLot) {
        this.prodLot = prodLot;
    }

    public String getDevice()
    {
        return device;
    }

    public void setDevice( String device )
    {
        this.device = device;
    }

    public String getPackageType()
    {
        return packageType;
    }

    public void setPackageType( String packageType )
    {
        this.packageType = packageType;
    }

    public String getBody()
    {
        return body;
    }

    public void setBody( String body )
    {
        this.body = body;
    }

    public String getLeadCount()
    {
        return leadCount;
    }

    public void setLeadCount( String leadCount )
    {
        this.leadCount = leadCount;
    }

    public String getWsrcv()
    {
        return wsrcv;
    }

    public void setWsrcv( String wsrcv )
    {
        this.wsrcv = wsrcv;
    }

    public String getWsInQty()
    {
        return wsInQty;
    }

    public void setWsInQty( String wsInQty )
    {
        this.wsInQty = wsInQty;
    }

    public String getWsbk()
    {
        return wsbk;
    }

    public void setWsbk( String wsbk )
    {
        this.wsbk = wsbk;
    }

    public String getProbe()
    {
        return probe;
    }

    public void setProbe( String probe )
    {
        this.probe = probe;
    }

    public String getWsfgWafer()
    {
        return wsfgWafer;
    }

    public void setWsfgWafer( String wsfgWafer )
    {
        this.wsfgWafer = wsfgWafer;
    }

    public String getWsfgDie()
    {
        return wsfgDie;
    }

    public void setWsfgDie( String wsfgDie )
    {
        this.wsfgDie = wsfgDie;
    }

    public String getWsSOD()
    {
        return wsSOD;
    }

    public void setWsSOD( String wsSOD )
    {
        this.wsSOD = wsSOD;
    }

    public String getWsTran()
    {
        return wsTran;
    }

    public void setWsTran( String wsTran )
    {
        this.wsTran = wsTran;
    }

    public String getAsRcvDate()
    {
        return asRcvDate;
    }

    public void setAsRcvDate( String asRcvDate )
    {
        this.asRcvDate = asRcvDate;
    }

    public String getAsRcvDie()
    {
        return asRcvDie;
    }

    public void setAsRcvDie( String asRcvDie )
    {
        this.asRcvDie = asRcvDie;
    }

    public String getAsBkWafer()
    {
        return asBkWafer;
    }

    public void setAsBkWafer( String asBkWafer )
    {
        this.asBkWafer = asBkWafer;
    }

    public String getAsBkDie()
    {
        return asBkDie;
    }

    public void setAsBkDie( String asBkDie )
    {
        this.asBkDie = asBkDie;
    }

    public String getLoadDate()
    {
        return loadDate;
    }

    public void setLoadDate( String loadDate )
    {
        this.loadDate = loadDate;
    }

    public String getAsActualQty()
    {
        return asActualQty;
    }

    public void setAsActualQty( String asActualQty )
    {
        this.asActualQty = asActualQty;
    }

    public String getOpticalInspect() {
        return opticalInspect;
    }

    public void setOpticalInspect(String opticalInspect) {
        this.opticalInspect = opticalInspect;
    }

    public String getDieAttach()
    {
        return dieAttach;
    }

    public void setDieAttach( String dieAttach )
    {
        this.dieAttach = dieAttach;
    }

    public String getWireBond()
    {
        return wireBond;
    }

    public void setWireBond( String wireBond )
    {
        this.wireBond = wireBond;
    }

    public String getMolding()
    {
        return molding;
    }

    public void setMolding( String molding )
    {
        this.molding = molding;
    }

    public String getPlating()
    {
        return plating;
    }

    public void setPlating( String plating )
    {
        this.plating = plating;
    }

    public String getForming()
    {
        return forming;
    }

    public void setForming( String forming )
    {
        this.forming = forming;
    }

    public String getPacking()
    {
        return packing;
    }

    public void setPacking( String packing )
    {
        this.packing = packing;
    }

    public String getLossQty()
    {
        return lossQty;
    }

    public void setLossQty( String lossQty )
    {
        this.lossQty = lossQty;
    }

    public String getAsSod()
    {
        return asSod;
    }

    public void setAsSod( String asSod )
    {
        this.asSod = asSod;
    }

    public String getAsrSod()
    {
        return asrSod;
    }

    public void setAsrSod( String asrSod )
    {
        this.asrSod = asrSod;
    }

    public String getAsTran()
    {
        return asTran;
    }

    public void setAsTran( String asTran )
    {
        this.asTran = asTran;
    }

    public String getFtRcvDate()
    {
        return ftRcvDate;
    }

    public void setFtRcv( String ftRcvDate )
    {
        this.ftRcvDate = ftRcvDate;
    }



    public String getFtBaking()
    {
        return ftBaking;
    }

    public void setFtBaking( String ftBaking )
    {
        this.ftBaking = ftBaking;
    }



    public String getFtSod()
    {
        return ftSod;
    }

    public void setFtSod( String ftSod )
    {
        this.ftSod = ftSod;
    }

    public String getFtrSod()
    {
        return ftrSod;
    }

    public void setFtrSod( String ftrSod )
    {
        this.ftrSod = ftrSod;
    }

    public String getShipTo()
    {
        return shipTo;
    }

    public void setShipTo( String shipTo )
    {
        this.shipTo = shipTo;
    }

    public String getRem()
    {
        return rem;
    }

    public void setRem( String rem )
    {
        this.rem = rem;
    }

    public String getRem2()
    {
        return rem2;
    }

    public void setRem2( String rem2 )
    {
        this.rem2 = rem2;
    }

    public String getFtBk() {
        return ftBk;
    }

    public void setFtBk(String ftBk) {
        this.ftBk = ftBk;
    }

    public String getFtQty() {
        return ftQty;
    }

    public void setFtQty(String ftQty) {
        this.ftQty = ftQty;
    }

    public String getFtLsQty() {
        return ftLsQty;
    }

    public void setFtLsQty(String ftLsQty) {
        this.ftLsQty = ftLsQty;
    }

    public String getFtpacking() {
        return ftpacking;
    }

    public void setFtpacking(String ftpacking) {
        this.ftpacking = ftpacking;
    }

    public String getFtOQCDate() {
        return ftOQCDate;
    }

    public void setFtOQCDate(String ftOQCDate) {
        this.ftOQCDate = ftOQCDate;
    }

    public String getUncfm() {
        return uncfm;
    }

    public void setUncfm(String uncfm) {
        this.uncfm = uncfm;
    }

    /**
     *  Method returns the sum of the quantity in the Assembly Process
     * @return int
     */
    public int getAssemblyQtyIn()
    {
        int optical     = 0;
        int dieAttach   = 0;
        int wireBond    = 0;
        int mold     = 0;
        int plat     = 0;
        int form     = 0;
        int pack     = 0;
        int asTransit     = 0;

        try { optical = Integer.parseInt( getOpticalInspect() ); } catch (NumberFormatException ignore) {}
        try { dieAttach = Integer.parseInt( getDieAttach() ); } catch (NumberFormatException ignore) {}
        try { wireBond = Integer.parseInt( getWireBond() ); } catch (NumberFormatException ignore) {}
        try { mold = Integer.parseInt( getMolding() ); } catch (NumberFormatException ignore) {}
        try { plat = Integer.parseInt( getPlating() ); } catch (NumberFormatException ignore) {}
        try { form = Integer.parseInt( getForming() ); } catch (NumberFormatException ignore) {}
        try { pack = Integer.parseInt( getPacking() ); } catch (NumberFormatException ignore) {}
         try { asTransit = Integer.parseInt( getAsTran() ); } catch (NumberFormatException ignore) {}

        return optical + dieAttach + wireBond + mold +  plat + form + pack + asTransit;

    }

    public int getTestQtyIn()
    {
        int ftBank     = 0;
        int ft   = 0;
        int ls    = 0;
        int ftBake     = 0;

        try { ftBank = Integer.parseInt( getFtBk() ); } catch (NumberFormatException ignore) {}
        try { ft = Integer.parseInt( getFtQty() ); } catch (NumberFormatException ignore) {}
        try { ls = Integer.parseInt( getFtLsQty() ); } catch (NumberFormatException ignore) {}
        try { ftBake = Integer.parseInt( getFtBaking() ); } catch (NumberFormatException ignore) {}


        return ftBank + ft + ls + ftBake;
    }

    public int getFgQtyIn()
    {
        int pack = 0;
        try { pack = Integer.parseInt( getFtpacking() ); } catch (NumberFormatException ignore) {}
        return pack;
    }
    /**
     *
     * @return String
     */
    public String toString()
    {

        StringBuffer buf = new StringBuffer();

        buf.append( "[ Customer Lot = " ).append( customerLot );
        buf.append( "] [Fab Lot = " ).append( fabLot );
        buf.append( "] [Spil Lot = " ).append( prodLot );
        buf.append( "] [Device = " ).append( device );
        buf.append( "] [package = " ).append( packageType );
        buf.append( "] [Body = " ).append( body );
        buf.append( "] [Lead Count = " ).append( leadCount );
        buf.append( "] [WSRCV = " ).append( wsrcv );
        buf.append( "] [ASRCV = " ).append( asRcvDate );
        buf.append( "] [ASRCVDEQTY = " ).append( asRcvDie );
        buf.append( "] [ASBK_W = " ).append( asBkDie );
        buf.append( "] [ASBK_D = " ).append( asBkWafer );
        buf.append( "] [LOAD = " ).append( loadDate );
        buf.append( "] [ACT_QTY = " ).append( asActualQty );
        buf.append( "] [2/O = " ).append( opticalInspect );
        buf.append( "] [D_A = " ).append( dieAttach );
        buf.append( "] [W_B = " ).append( wireBond );
        buf.append( "] [MOLD = " ).append( molding ).append( "]" );

        return buf.toString();
    }   

    public int getTestQty()
    {
        int ft = 0;
        int ls = 0;
        int ftBaking = 0;
        int ftPacking = 0;

        try{ft = Integer.parseInt(getFtQty());} catch (NumberFormatException ignore) {}
        try {ls = Integer.parseInt(getFtLsQty());} catch (NumberFormatException ignore) {}
        try {ftBaking = Integer.parseInt(getFtBaking());} catch (NumberFormatException ignore) {}
        try {ftPacking = Integer.parseInt(getFtpacking());} catch (NumberFormatException ignore) {}

        return ft + ls + ftBaking + ftPacking;
    }

    public int getSortQty()
    {
        int probe = 0;
        int wsfg = 0;

        try{probe = Integer.parseInt(getProbe());} catch (NumberFormatException ignore) {}
        try {wsfg = Integer.parseInt(getWsfgWafer());} catch (NumberFormatException ignore) {}

        return probe + wsfg;
    }
}


